package com.kid.keep.mapper;

import com.honeybee.cloud.framework.common.mapper.BaseCovertMapper;
import com.kid.keep.bo.CheckItemReportBO;
import com.kid.keep.bo.ChildCheckItemBO;
import com.kid.keep.bo.ReportRecommendationBO;
import com.kid.keep.dto.CheckItemDetailDTO;
import com.kid.keep.dto.CheckItemReportDTO;
import com.kid.keep.dto.CheckItemReportDetailDTO;
import com.kid.keep.po.CheckItemReport;
import com.kid.keep.po.Message;
import com.kid.keep.vo.CheckItemDetailVO;
import com.kid.keep.vo.CheckItemReportDetailVO;
import com.kid.keep.vo.CheckItemReportStatisticsDetailVO;
import com.kid.keep.vo.CheckItemReportVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.Date;
import java.util.List;

/**
 * @Description 转换mapper
 * @Author JOHN
 * @Create 2020-01-02
 * @Since 1.0.0
 */
@Mapper(componentModel = "spring")
public interface ICheckReportCovertMapper extends BaseCovertMapper {
    /**
     * dto to  vo
     *
     * @param checkItemReportDTOList
     * @return
     */

    List<CheckItemReportStatisticsDetailVO> toStatisticsVO(List<CheckItemReportDTO> checkItemReportDTOList);
    /**
     * dto to  vo
     *
     * @param checkItemReportDTOList
     * @return
     */
    @Mappings({
            @Mapping(target = "id", source = "id", qualifiedByName = "toString"),
    })
    CheckItemReportStatisticsDetailVO toStatisticsVO(CheckItemReportDTO checkItemReportDTOList);

    /**
     * dto to  vo
     *
     * @param checkItemReportDetailDTO
     * @return
     */
    @Mappings({
            @Mapping(target = "id", source = "id", qualifiedByName = "toString"),
    })
    CheckItemReportDetailVO toVO(CheckItemReportDetailDTO checkItemReportDetailDTO);
    /**
     * dto to  vo
     *
     * @param checkItemReportDetailDTO
     * @return
     */
    @Mappings({
            @Mapping(target = "id", source = "id", qualifiedByName = "toString"),
    })
    CheckItemDetailVO toVO(CheckItemDetailDTO checkItemReportDetailDTO);

    /**
     * po to  dto
     *
     * @param checkItemReport
     * @param items
     * @return
     */
    CheckItemReportDetailDTO toReportDTO(CheckItemReportBO checkItemReport, List<ChildCheckItemBO> items, String recommendations, String representation);

    /**
     * po to  dto
     *
     * @param checkItemReportList
     * @return
     */

    List<CheckItemReportDTO> toDTO(List<CheckItemReportBO> checkItemReportList);

    /**
     * po to  dto
     *
     * @param checkItemReport
     * @return
     */

    CheckItemReportDTO toDTO(CheckItemReportBO checkItemReport);
    /**
     * po to  dto
     *
     * @param checkItemReport
     * @return
     */

    CheckItemReportDTO toDTO(CheckItemReport checkItemReport);

    /**
     * po to  dto
     *
     * @param checkItemReport
     * @return
     */

    @Mappings({
            @Mapping(target = "id", source = "id", qualifiedByName = "toString"),
    })
    CheckItemReportVO toVO(CheckItemReportDTO checkItemReport);
    /**
     *  to po
     *
     * @param status
     * @param createDate
     * @return
     */
    @Mappings({
            @Mapping(target = "reportId", source = "checkItemReport.id"),
            @Mapping(target = "status", source = "status"),
            @Mapping(target = "type", source = "type"),
            @Mapping(target = "createDate", source = "createDate"),
            @Mapping(target = "content", source = "content"),
            @Mapping(target = "id", source = "id"),
            @Mapping(target = "creatorId", source = "creatorId"),
    })
    Message toPO(CheckItemReportBO checkItemReport, Integer status, Integer type, Date createDate,Long id,String content,Long creatorId);
}
